<template>
  <div class="recommend">
    <div class="slider-wrapper">
      <div class="slider-content">
        <slider v-if="sliders.length" :sliders="sliders"></slider>
      </div>
    </div>
  </div>
</template>

<script>
import Slider from "@/components/base/slider/slider";

import { getSliders } from "@/service/recommend";

export default {
  name: "Recommend",
  components: {
    Slider,
  },
  data() {
    return {
      sliders: [],
    };
  },
  async created() {
    const result = await getSliders();
    console.log(result.banners);
    this.sliders = result.banners;
  },
};
</script>

<style lang="scss" scoped>
.recommend {
  position: fixed;
  width: 100%;
  top: 88px;
  bottom: 0;
  overflow: scroll;
  .slider-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 40%;
    overflow: hidden;
    .slider-content {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
    }
  }
}
</style>